package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._10观察者模式._1基本代码;

//具体观察者类
class ConcreteObserver extends Observer{
    private String name;
    private Subject sub;
    public ConcreteObserver(String name,Subject sub){
        this.name = name;
        this.sub = sub;
    }
    public void update(){
        System.out.println("观察者"+this.name+"的新状态是"+this.sub.getSubjectState());
    }
}
